home *** CD-ROM | disk | FTP | other *** search
- /*
- * $VER: EPatsch 1.0 (30.6.94)
- *
- * patch to make OpenFromLock() work via Envoy
- *
- * (C) 1994 by Bernhard Möllemann
- *
- * This patch applies only to filesystem.service
- * "fs 40.11 (6.9.93)" or "fs 40.12 (19.10.93)"
- * which was distributed with Envoy 1.0 and 1.6/1.65
- *
- * The filesystem.service from Envoy has a bug: it doesn't initialize
- * dp_Arg1 when sending ACTION_FH_FROM_LOCK to the FS on the remote system,
- * conjuring enforcer hits or even worse things from the FileSystem.
- *
- * Inspecting the code (following a Hint of Matthias Scheler) shows,
- * that there is a FileHandle build up just like in ACTION_FINDXXX.
- * But this FileHandle is not used, instead the original pointer
- * from the transmitted packet is used, which does not contain
- * usable data. So this patch only puts the address of the prepared
- * FileHandle into the right place.
- *
- * usage: EPatsch.rexx SYS:Envoy/Services/filesystem.service
- * (or where your filesystem.service is located)
- *
- * !!! PLEASE make a backup of your filesystem.service !!!
- */
-
- pw.0=7
- pw.1='261B 260D'
- pw.2='281B E483'
- pw.3='2A1B 2543'
- pw.4='2C2A 0014'
- pw.5='0020 261B'
- pw.6='2E2A 281B'
- pw.7='0024 2A1B'
-
- offset11=14410
- offset12=14418
-
- qt=d2c(34)
-
- Options Results
- Address Command
-
- Parse ARG fs
- offset=0
-
- if ( fs='' ) then do
- say "in which drawer is your Envoy-Installation located?"
- pull envoy
- if ( right(envoy,1)~=':' ) then
- envoy=envoy'/'
- fs=envoy'Services/filesystem.service'
- end
-
- if ( open(fsh,fs,'A')~=0 ) then do
- Call Seek(fsh,90,'B')
- str=ReadCH(fsh,25)
- if ( Left(str,23)='$VER: fs 40.11 (6.9.93)' ) then
- offset=offset11
- else if ( Left(str,25)='$VER: fs 40.12 (19.10.93)' ) then
- offset=offset12
-
- if ( offset~=0 ) then do
- Call Seek(fsh,offset,'B')
- str=ReadCH(fsh,pw.0*2)
- do k=1 for pw.0
- if ( substr(str,k*2-1,2)~=d2c(x2d(left(pw.k,4)),2) ) then do
- do k=1 for pw.0
- if ( substr(str,k*2-1,2)~=d2c(x2d(right(pw.k,4)),2) ) then do
- say "binary differs from expected code - aborting"
- say "offset $"d2x(offset)" expected: $"left(pw.k,4)" actual: $"d2x(c2d(substr(str,k*2-1,2)),4)
- exit(10)
- end
- say qt||fs||qt" is already patched"
- exit(5)
- end
- end
- end
- if ( Seek(fsh,offset,'B')=offset ) then do
- str=''
- do k=1 for pw.0
- str=str||d2c(x2d(right(pw.k,4)),2)
- end
- if ( WriteCH(fsh,str)=pw.0*2 ) then do
- say "sucessfully patched "qt||fs||qt
- end; else do
- say "could not write to "qt||fs||qt" - file may be left damaged"
- exit(20)
- end
- end; else do
- say "could not seek to patch position"
- exit(10)
- end
- end; else do
- say "this is not the right Version fs 40.11 (6.9.93) or fs 40.12 (19.10.93)"
- say "of "qt||fs||qt
- exit(10)
- end
- end; else do
- say "cannot open "qt||fs||qt
- exit(10)
- end
-
- /* my next patch will be written in installer 8-) */
-